package Model.StatisticalReport;

import java.util.HashMap;
import java.util.Map;

/**
 * 被护理人员护理类别分类
 * 一类
 * 二类
 * 特殊
 * 帮困
 */
public enum IndividualClass {
    /**
     * 一类
     */
    FIRST(1, "一类"),

    /**
     * 二类
     */
    SECOND(2, "二类"),

    /**
     * 特殊
     */
    SPECIAL(3, "特殊"),

    /**
     * 帮困
     */
    AID(4, "帮困");




    private int classId;
    private String label;

    public int getClassId() {
        return classId;
    }

    public String getLabel() {
        return label;
    }

    /**
     * 通过classId取枚举
     * @param classId
     * @return
     */
    public static IndividualClass get(int classId){
        for (IndividualClass enums : IndividualClass.values()) {
            if (enums.getClassId() == classId) {
                return enums;
            }
        }
        return null;
    }

    IndividualClass(int classId, String label){
        this.classId = classId;
        this.label = label;
    }


    /**
     * 将所有枚举值转化为HashMap
     * @return
     */
    static public Map<Integer, String> getValues(){
        Map<Integer, String> res = new HashMap<>();
        for (IndividualClass each : IndividualClass.values()) {
            res.put(each.getClassId(), each.getLabel());
        }
        return res;
    }

    public String toString(){return this.getLabel();}
}
